<!doctype html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Tendências de Faturamento - Configuração de Inflação</title>
    
    <style type="text/css">
      .moeda{
      	width: 65px;
      }
    </style>
    
	<%@ include file="head.jsp" %>	
    <script type="text/javascript" src="resources/js/moeda.js"></script>
        
		<script type="text/javascript">
		
		  var _gaq = _gaq || [];
		  _gaq.push(['_setAccount', 'UA-35513738-1']);
		  _gaq.push(['_trackPageview']);
		
		  (function() {
		    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		  })();
		
		</script>		
        
  </head>

  <body>
	<%@ include file="menu.jsp" %>
    
    <div class="container-fluid">
		<div class="row-fluid">
		
			<div class="page-header"><h1>Configuração de Inflação</h1></div>
  			
  			<c:if test="${mensagemSucesso != null}">
				<div class="alert alert-info" style="text-align: center;">${mensagemSucesso}</div>  			
  			</c:if>
  			
  			<form:form method="post" action="inflacao" modelAttribute="inflacaoAnualForm">
  			
			<table>
				<thead>
					<tr>
						<th>Ano</th>
						<c:forEach items="${inflacaoAnualForm.listInflacao}" var="anoInflacao" varStatus="status">
							<th>${anoInflacao.ano}<input type="hidden" name="listInflacao[${status.index}].ano" value="${anoInflacao.ano}" ></th>
						</c:forEach>
					</tr>
				</thead> 
				<tbody>
					<tr>
						<th>Inflação(%)</th>
						<c:forEach items="${inflacaoAnualForm.listInflacao}" var="anoInflacao" varStatus="status">
							<td>
								<input type="text" maxlength="16" onkeypress="reais(this,event)" onkeydown="backspace(this,event)" name="listInflacao[${status.index}].valorMoeda" value="${anoInflacao.valorMoeda}" class="moeda" />
							</td>
						</c:forEach>
					</tr>
				</tbody>
			</table>
			<br/>
			
			<input type="submit" class="btn btn-primary btn-large" value="Salvar" />

			</form:form>
			
			<%@ include file="rodape.jsp" %>
		</div>
    </div>
  </body>
</html>  